<template>
  <div>
    <el-form ref="form" :model="form" label-width="120px">
      <el-form-item label="自定义链接">
        <el-input v-model="form.path" @input="handleInput" />
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
export default {
  name: 'CustomerPageUrl',
  props: {
    row: {
      type: Object
    }
  },
  data() {
    return {
      form: {
        path: ''
      },
      rules: {
        path: [
          { required: true, message: '请输入自定义链接', trigger: 'blur' }
        ]
      }
    }
  },
  mounted() {
    this.form.path = this.row.openPath
  },
  methods: {
    handleInput() {
      const params = {
        insidePage: '自定义页面',
        path: this.form.path,
        mode: 'navigateTo',
        insideParams: {
          insidePageType: 'CUS_PAGE_URL',
          commonCode: '',
          remark: '站内链接 > 自定义页面  > '
        }
      }
      this.$emit('selectInsideLink', { type: 'CUS_PAGE_URL', params })
    }
  }
}
</script>

<style scoped></style>
